package com.ebo.download.download2;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

/**
 * Created by admin on 2017/4/24.
 */

public class DownloadReceiver  extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle bundle = intent.getExtras();
        int result = bundle.getInt("result");
        final String filepath =  bundle.getString("filepath");
        mycontext.onDownloadResult(result,filepath);
    }
    private MyContext mycontext;
    public interface MyContext {
        public void onDownloadResult(int result, final String filepath);
    }
    public void setMyActivityListener( MyContext context) {
        this.mycontext = context;
    }
}